<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="h" uri="/syzg-html"%>
<!DOCTYPE html>
<html>
<body>
<div class="modal fade bs-example-modal-lg" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">新增信息</h4>
      </div>
      <div class="modal-body" id="modalCore">
        <form class="form-horizontal" role="form" id="aeForm" name="aeForm">
          <fieldset>
            <!-- generate code start -->

            <div class="form-group">
              <label class="col-sm-2 control-label" for="id">ID</label>
              <div class="col-sm-3">
                <input type="text" id="id" name="id" value="${basicdata.id}" class="form-control" readonly="readonly"/>
              </div>

              <label class="col-sm-2 control-label" for="code">标识</label>
              <div class="col-sm-3">
                <input type="text" id="code" name="code" value="${basicdata.code}" class="form-control" placeholder="必填项"/>
              </div>
            </div>

            <div class="form-group">
              <label class="col-sm-2 control-label" for="parentId">父ID</label>
              <div class="col-sm-3">
                <input type="text" id="parentId" name="parentId" value="${basicdata.parentId}" class="form-control"/>
              </div>
              <label class="col-sm-2 control-label" for="defaultFlag">是否默认</label>
              <div class="col-sm-3">
                <input type="radio" id="defaultFlag_yes" name="defaultFlag" value="1" <c:if test="${basicdata.defaultFlag=='1'}">checked="checked"</c:if>/>是&nbsp;&nbsp;
                <input type="radio" id="defaultFlag_no" name="defaultFlag" value="0" <c:if test="${basicdata.defaultFlag=='0'||basicdata.defaultFlag==null}">checked="checked"</c:if>/>否
              </div>
            </div>

            <div class="form-group">
              <label class="col-sm-2 control-label" for="type">数据类型</label>
              <div class="col-sm-3">
              	<select id="type" name="type" class="form-control" >
              		<option value="SYSTEM" <c:if test="${basicdata.type=='SYSTEM'}">selected="true"</c:if>>系统数据</option>
              		<option value="BUSINESS" <c:if test="${basicdata.type=='BUSINESS'}">selected="true"</c:if>>业务数据</option>
              	</select>
              </div>
              <label class="col-sm-2 control-label" for="comment">内容</label>
              <div class="col-sm-3">
                <textarea id="comment" name="comment" class="form-control" rows="5" placeholder="必填项">${basicdata.comment}</textarea>
              </div>
            </div>
			<!-- generate code end -->
          </fieldset>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" onclick="submitSave('add');">保存</button>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
$('#aeForm').bootstrapValidator({
  message: 'This value is not valid',
  feedbackIcons: {
      valid: 'glyphicon glyphicon-ok',
      invalid: 'glyphicon glyphicon-remove',
      validating: 'glyphicon glyphicon-refresh'
  },
  fields: {
      code: {
    	  group: '.col-sm-3',
          message: '标识无效',
          validators: {
              notEmpty: {
                  message: '标识不允许为空'
              },
              stringLength: {
                  min: 2,
                  max: 30,
                  message: '标识的长度必须在2-30个字符之间'
              }
          }
      },comment: {
    	  group: '.col-sm-3',
          message: '内容无效',
          validators: {
              notEmpty: {
                  message: '内容不允许为空'
              },
              stringLength: {
                  min: 2,
                  max: 200,
                  message: '内容的长度必须在2-200个字符之间'
              }
          }
      }
  	}
}).on('success.form.bv', function(e, data) {
	FormFunction.submitSave('add');
});
</script>
</body>
</html>

